package com.menggudf.enums;

/**
 * @author zengqingdong 2023/9/8
 */
public enum RuleConditionEnum {

    ALL_CONDITION("满足以下所有条件", 1),
    ONLY_ONE_CONDITION("满足以下任一条件", 2),
    NOT_CONDITION("无条件限制", 3);

    private String label;

    private Integer value;


    RuleConditionEnum(String label, Integer value) {
        this.label = label;
        this.value = value;
    }

    public String getLabel() {
        return label;
    }

    public void setLabel(String label) {
        this.label = label;
    }

    public Integer getValue() {
        return value;
    }

    public void setValue(Integer value) {
        this.value = value;
    }

    public static RuleConditionEnum getEumByCode(int value) {
        for (RuleConditionEnum ruleConditionEnum : RuleConditionEnum.values()) {
            if (ruleConditionEnum.getValue() == value) {
                return ruleConditionEnum;
            }
        }
        return null;
    }

}
